import Vue 			from 'vue'
import util 		from '../../util'
import axios 		from 'axios'
import { Toast,Dialog,List } 	from 'vant';
Vue.use(Toast,Dialog,List);

export default {
	name: 'myMore',
	data(){
		return {
			token:'',
		}
	},
	computed:{
		isIphoneX(){
			return util.isIphoneX()
		},
		isIphone(){
			return util.client()
		},
		isMYKEY(){
			return util.isMYKEY()
		}
	},
	methods:{
		init(){
			
		},
		goBack(){
			util.navigateBack(-1,this)
		}
	},
	created() {
		util.waitSDKReady().then(token => {
			this.token = token;
			this.init();
		}).catch((e) => {
			Toast('获取token失败')
		})
		setTimeout(() => {
			util.registerHandler('refreshCommonRequestWhenGoBackView',res => {
				util.callHandler('setStatusBarStyle',{
					style:'dark'
				})
			})
			//退出登录的时候native调用H5方法清除token缓存
			util.registerHandler('loginOutDeleteToken',res => {
				window.token = '';
				this.token = '';
				localStorage.removeItem('token');
			})
			util.callHandler('setStatusBarStyle',{
				style:'dark'
			})
		},500)
    }
}